home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk191 / lz200 / lz200.doc < prev    next >
Text File  |  1995-03-19  |  23KB  |  626 lines

  1.  
  2.                                       LZ 2.00
  3.                                 7th February, 1991
  4.  
  5.                             Written by Jonathan Forbes
  6.  
  7.  
  8.    About LZ
  9.  
  10.    LZ is a freely distributable, public domain piece of software.  You may
  11. upload it wherever you choose.
  12.  
  13.  
  14.    The LZ package (LZ200.LZH) consists the following files:
  15.  
  16.       LZ          - The archiver/extractor itself
  17.       LZ200.doc   - LZ documentation (this file)
  18.  
  19.  
  20.    Disclaimer
  21.  
  22.    I am in no way responsible for anything this program does; you are using it
  23. entirely at your own risk!
  24.  
  25.  
  26.    What is LZ?
  27.  
  28.    Currently, LZ is by far the fastest .LZH archiver and extractor available
  29. for the Amiga!  LZ is compatible with MS-DOS version 1.13c of Lharc and Amiga
  30. Lharc 1.3.
  31.  
  32.  
  33.    Acknowledgements
  34.  
  35.    The original Lharc (MS-DOS) was written by Haruyasu Yoshizaki.  I took his
  36. freely distributable source code "Lzhuf.c", and rewrote it in assembly
  37. language (very highly optimised assembly language, I might add).  I used
  38. "lharc.c" (which is full of MS-DOS specific code) as a reference, but did not
  39. use it as a base for the Amiga version, which I wrote from scratch.
  40.  
  41.    LZ 2.0 is a significant improvement over the original .LZH algorithm in
  42. that it employs modern data compression technology to provide better
  43. compression while doubling or tripling encoding speed and retaining 100%
  44. compatibility with the .LZH format.
  45.  
  46.  
  47.    How fast is LZ?
  48.  
  49.    LZ is currently the fastest .LZH utility for the Amiga.  No other available
  50. Amiga archiver even comes close to LZ's legendary performance for either
  51. compressing or decompressing.  LZ 2.0 can achieve peak compression speeds of
  52. up to three times those of LZ 0.91.
  53.  
  54.    Speedwise, LZ outperforms Lharc 1.3, LharcA .99d, Pkazip 1.01, and just
  55. about any other Amiga archiving utility in existence, excepting Zoo 2.01.
  56.  
  57.    In terms of degree of compression, LZ, on average, outperforms every other
  58. archiver (including the other .LZH archivers) currently available for the
  59. Amiga.  Note, this is on average; once in a blue moon Pkazip will outperform
  60. LZ on a text file, and will produce an output file a slightly smaller than
  61. that produces by LZ.  However, since this ocurrance is about as frequent as
  62. a total solar eclipse, it shouldn't worry you.
  63.  
  64.    The files being compressed and decompressed in the test, were those on
  65. Fred Fish disk #245.
  66.  
  67.                       * - Different algorithm/encoding scheme
  68.  
  69.                                                       *
  70.              |  (2.00)  | (.91) | (1.0) | (.99d) | (1.01)
  71.              |    LZ    |   LZ  | Lharc | LharcA | PkaZip
  72. Fish245.LZH  |   5:33   | 11:33 | 26:29 |    ?   |  10:31  compressing
  73.              |   1:38   |  1:43 |  5:12 |   2:34 |   2:53  decompressing
  74.  
  75.  
  76. File         LZ     LZ   Lharc  LharcA  Pkazip   Zoo    Arc    Ape
  77. Name        2.0    0.91   1.3     .99d    1.01   2.01   0.23   1.0
  78. ---------- -----  -----  -----  ------  ------  -----  -----  -----
  79. UserManual    88    244    268     211     164     42    112    614 <- compress
  80.               19     19     35      27      21     12     19    116 <- extract
  81.            64066  66693  66683   66682   61796  78279  80469  66329 <- size
  82.  
  83. AmigaBASIC    47     48     90      74      91     30    129   ...  <- compress
  84.               20     21     33      25      16      9     10   ...  <- extract
  85.            66877  67801  67804   67804   69121  83527  85355   ...  <- size
  86.  
  87.  
  88.    LZ is consistently faster than all other archivers by the margins shown here.
  89. LZ also creates output files up to 5% smaller than those produced any other .LZH
  90. archiver.  Although there have been many disputes over the compression achieved
  91. by .ZIP files and .LZH files, this difference may well tip the balance towards
  92. .LZH files.
  93.  
  94.  
  95.    Invokation
  96.  
  97.    Typing "LZ" from the CLI, without any parameters, will reveal a help screen
  98. similar to the following:
  99.  
  100.                              Summary of commands:
  101.  
  102.   a    Add file(s) to archive                f   Freshen file(s) in archive
  103.   e,x  Extract file(s) from archive          u   Update file(s) in archive
  104.   l,v  Display archive contents              t   Test archive integrity
  105.   d    Delete file(s) from archive           m   Move file(s) to archive
  106.  
  107.                              Summary of options:
  108.  
  109.   -a  Preserve file attributes              -N  No console output
  110.   -A  Set archive flag                      -p  Pause after loading
  111.   -b  Set input/output buffer               -P  Set task priority
  112.   -c  Confirm files                         -r  Archive subdiectories
  113.   -D  Alternative display                   -u  Upper case filenames
  114.   -f  Ignore filenotes                      -U  Update rate
  115.   -i  Read file list from file              -w  Set work directory
  116.   -l  Lower case filenames                  -x  Preserve path names
  117.   -L  Create list file                      -z  Store files
  118.   -m  Disable message query                 -Z  Compress archives
  119.   -n  No progress indicator
  120.  
  121.    The usage line below is also displayed:
  122.  
  123.    Usage: LZ [-options] <Command> <Archive> [FilePatterns] [DestPath]
  124.  
  125.    While items in square brackets are optional, items in angle brackets are
  126. mandatory.  LZ will append a .LZH to the <Archive> parameter if the name of
  127. the archive you supply does not already end in .LZH, but ONLY if there isn't
  128. already a dot ( . ) in the name.  This extra clause is for the benefit of
  129. FidoNet users who have their mail archived in the .LZH format.  i.e.:
  130.  
  131.  
  132.    MyFile         becomes    MyFile.LZH
  133.    MyFile.LZH     remains    MyFile.LZH
  134.    01234567.SA0   remains    01234567.SA0
  135.  
  136.  
  137.    A detailed description of each of LZ's commands follows:
  138.  
  139.  
  140.    Commands
  141.  
  142.    a    Add file(s) to archive
  143.  
  144.         The add command will add files to a .LZH archive.  If the specified
  145.         archive does not already exist, then it will automatically be created.
  146.         It is not possible to add a file which is already present in archive;
  147.         if this is attempted, then an error message will be displayed.
  148.  
  149.         By default, only filenames are stored in the archive; if you wish to
  150.         store path names also, then you will have to use the -x option
  151.         (explained later).  If you wish to store entire subdirectories (i.e.
  152.         descend recursively through a directory tree), then you will have to
  153.         use the -r option (explained later).
  154.  
  155.         Multiple files may be added with one command.  In addition, both
  156.         AmigaDOS and ARP wildcards are also supported.
  157.  
  158.         Examples:
  159.  
  160.         1) To add "BLAH" to "myarchive.LZH", you would enter the following
  161.            command:
  162.  
  163.               Lz a myarchive.LZH blah
  164.  
  165.  
  166.         2) To add "THEFILE", "HI", and "KING" to "myarchive.LZH", you would
  167.            enter the following command:
  168.  
  169.               Lz a myarchive.LZH thefile hi king
  170.  
  171.  
  172.         3) To add everything ending in ".INFO" to "myarchive.LZH", you would
  173.            enter:
  174.  
  175.               Lz a myarchive.LZH #?.info
  176.  
  177.  
  178.    e,x  Extract file(s) from archive
  179.  
  180.         The extract command will extract files from an archive.  If you wish
  181.         to extract files from multiple archives, then you will have to use
  182.         a wildcard.  By default, all files in the archive will be extracted.
  183.         If you wish only specific files to be extracted, then the names of
  184.         these files should follow the archive name (wildcards are accepted here.)
  185.  
  186.         If any file following the archive name ends in a '/' or a ':', then
  187.         that directory will be used as the destination directory in which all
  188.         extracted files will be stored.
  189.  
  190.         By default, existing files will not be overwritten; instead, you will
  191.         be presented with the following:
  192.  
  193.         File 'whatever' already exists -overwrite? (Yes/No/All/Quit):
  194.  
  195.         Your response is hotkeyed, so it is not necessary to hit return.  If
  196.         you enter "Y", then the file will be overwritten.  If you enter "N",
  197.         then it will not be extracted.  If "A" is entered, then all files from
  198.         then on will automatically be overwritten without prompting you.  This
  199.         includes files in other archives, if you asked Lz to extract multiple
  200.         archives, using a wildcard.
  201.  
  202.         If you do not wish to be prompted for existing files, then use the -m
  203.         option (explained later.)
  204.  
  205.         Please note that if you wish to extract files from multiple archives
  206.         with one command, it can only be done with wildcards; you cannot enter
  207.         the name of each archive on the command line.  For example:
  208.  
  209.               Lz x arc1.LZH arc2.LZH arc3.LZH
  210.  
  211.         The above command would attempt to extract "arc2.LZH" and "arc3.LZH"
  212.         from "arc1.LZH".  The way to get around this is to type:
  213.  
  214.               Lz x arc#?.LZH
  215.  
  216.         However, there are often times when a single wildcard cannot cover all
  217.         of the files you wish to extract; if this is the case, you will have
  218.         to invoke Lz more than once.
  219.  
  220.         Examples:
  221.  
  222.         1) To extract all files from "myarchive.LZH", you would enter the
  223.            following command:
  224.  
  225.               Lz x myarchive.LZH
  226.  
  227.  
  228.         2) To extract "BLAH" from "myarchive.LZH", you would enter the
  229.            following command:
  230.  
  231.               Lz x myarchive.LZH blah
  232.  
  233.  
  234.         3) To extract all ".INFO" files from all archives, you would enter the
  235.            following command:
  236.  
  237.               Lz x #?.LZH #?.info
  238.  
  239.  
  240.         4) To extract "BLAH", "WHATEVER", and all ".INFO" files from
  241.            myarchive.LZH to the destination directory "HDISK:ArchiveOutput/",
  242.            you would enter any of the following commands (they all perform
  243.            exactly the same function, since the destination directory may be
  244.            placed anywhere after the archive name):
  245.  
  246.               Lz x myarchive.LZH blah whatever #?.info HDISK:ArchiveOutput/
  247.               Lz x myarchive.LZH HDISK:ArchiveOutput/ blah whatever #?.info
  248.               Lz x myarchive.LZH blah whatever HDISK:ArchiveOutput/ #?.info
  249.  
  250.  
  251.    l,v  List files in archive
  252.  
  253.         The list command will display a verbose listing of the files within the
  254.         specified archive(s) (wildcards are allowed).  The listing will be in
  255.         the following format:
  256.  
  257.         Original Packed Ratio  Date      Time   CRC  Name
  258.         -------- ------  --- --------- -------- ---- ------------
  259.             3026    851  71% 11-Jun-90 19:01:48 E7A9 diskspeed.a3000
  260.              841    524  37% 11-Jun-90 19:01:50 1309 si.a3000
  261.              937    586  37% 11-Jun-90 19:01:52 AE7B speed.a3000
  262.         -------- ------  ---
  263.             4804   1961  59%         3 file(s)
  264.  
  265.         Heading    Meaning
  266.  
  267.         Original - The size of the file before compression
  268.         Packed   - The size of the file after compression
  269.         Ratio    - Compression degree; the higher the better
  270.         Date     - The file's creation date
  271.         Time     - The file's creation time
  272.         CRC      - 16-bit Cyclic Redundancy Check
  273.         Name     - File name (including directory path, if present)
  274.  
  275.         Examples:
  276.  
  277.         1) To list all files in "myarchive.LZH", you would enter the following
  278.            command:
  279.  
  280.               Lz v myarchive.LZH
  281.  
  282.  
  283.         2) To list all files in all archives ending in "e", you would enter the
  284.            following command:
  285.  
  286.               Lz v #?e.LZH
  287.  
  288.            Please note that since Lz automatically appends a .LZH to the
  289.            archive name if it does not already end in .LZH (with one exception
  290.            mentioned earlier), the following command is equally valid to the
  291.            one shown above:
  292.  
  293.               Lz v #?e
  294.  
  295.  
  296.    d    Delete file(s) from archive
  297.  
  298.         The delete command will remove files from the archive.  The names of
  299.         the files to be deleted should follow the archive name.  Wildcards are
  300.         allowed.
  301.  
  302.         Please note that items in subdirectories are also checked, so #?.info
  303.         will delete all .info files in the archive, wherever they may be.
  304.  
  305.         Examples:
  306.  
  307.         1) To delete "BADFILE" from myarchive.LZH, you would enter the
  308.            following command:
  309.  
  310.               Lz d myarchive.LZH badfile
  311.  
  312.  
  313.         2) To delete "BADFILE" and all ".INFO" files from myarchive.LZH, you
  314.            would use the following command:
  315.  
  316.               Lz d myarchive.LZH badfile #?.info
  317.  
  318.  
  319.         3) To delete all "README.BBS" files from ALL of your archives, it is
  320.            only necessary to type:
  321.  
  322.               Lz d #?.LZH README.BBS
  323.  
  324.  
  325.    m    Move file(s) to archive
  326.  
  327.         The move command behaves in exactly the same way as the add command,
  328.         except that files are deleted after they are added to the archive.
  329.  
  330.         Examples:
  331.  
  332.         1) To move "MYFILE" to myarchive.LZH, you would enter the following
  333.            command:
  334.  
  335.               Lz m myarchive.LZH myfile
  336.  
  337.         2) To move all files ending in ".INFO" to myarchive.LZH, you would
  338.            enter the following command:
  339.  
  340.               Lz m myarchive.LZH #?.info
  341.  
  342.  
  343.    f    Freshen file(s) in archive
  344.  
  345.         The freshen command will replace a file in the archive only if the
  346.         file is already present in the archive, and the file to be added has
  347.         a later date.
  348.  
  349.  
  350.    u    Update file(s) in archive
  351.  
  352.         The update command behaves in exactly the same way as the add command,
  353.         unless a file to be added is already present in the archive, in which
  354.         case LZ will compare the dates of both files, and will make sure that
  355.         the newer file is added to/retained in the archive.
  356.  
  357.  
  358.    t    Test archive integrity
  359.  
  360.         The test command will test every file in the archive (by extracting
  361.         it internally), and will inform you of any corrupted files (i.e. files
  362.         which fail their CRC.)
  363.  
  364.         Examples:
  365.  
  366.         1) To test all files in myarchive.LZH, you would enter the following
  367.            command:
  368.  
  369.               Lz t myarchive.LZH
  370.  
  371.         2) To test all files in all archives, you would enter the following
  372.            command:
  373.  
  374.               Lz t #?.LZH
  375.  
  376.         3) To test the file named "boing" in the archive "splat.lzh", you would
  377.            enter the following command:
  378.  
  379.               Lz t splat.LZH boing
  380.  
  381.  
  382.  
  383.    Options
  384.  
  385.    -a   Preserve file attributes
  386.  
  387.         When this option is used, any files added to the archive will have
  388.         their attributes preserved (the default is for all files to be rwed).
  389.         The eight possible attributes are listed below, but will not be
  390.         explained here (a full explanation should be present in any AmigaDOS
  391.         manual):
  392.  
  393.         r: Read
  394.         w: Write
  395.         e: Execute
  396.         d: Delete
  397.         s: Script
  398.         a: Archive
  399.         p: Protect
  400.         h: Hidden
  401.  
  402.         If this option is not specified, then all files archived or extracted
  403.         will automatically be "rwed."  If this flag is used, then all
  404.         attributes (rwedsaph) will be preserved.  Please note that in order for
  405.         attributes to be preserved, the -a option must be used both when
  406.         archiving and extracting.
  407.  
  408.         When extracting, use -a only on files which have been compressed by
  409.         Amiga .LZH archivers; if you don't, you'll end up with files with
  410.         strange attributes, although no harm will be done.  Similarly, if you
  411.         know that your archive might be extracted on an IBM system, you should
  412.         not use the -a option, since they will have similar problems.
  413.  
  414.  
  415.    -A   This option will set the archive flag of any archive LZ creates or
  416.         adds files to.  It will also unset the executable flag.  Thus, your
  417.         archive will have the following flags set:
  418.  
  419.         ---arw-d
  420.  
  421.  
  422.    -b   Set i/o buffer size
  423.  
  424.         This option will set the i/o buffer size to the number immediately
  425.         following the option, which must be expressed in K.  For example,
  426.         -b32 would give you a 32k i/o buffer.  LZ's i/o buffer size is limited
  427.         only by available memory, so very large buffer sizes (128k+) are
  428.         acceptable.
  429.  
  430.         Note that changing the i/o buffer size on an 68000 Amiga when all work
  431.         is being done in a RAM drive doesn't speed things up; these options are
  432.         mainly for floppy drive users and 68020-68040 users.
  433.  
  434.  
  435.    -c   Confirm file names
  436.  
  437.         This option will cause LZ to prompt you with yes/no/all/quit for every
  438.         file to be added to or extracted from an archive.  This option can be
  439.         useful when used in conjunction with wildcards.
  440.  
  441.  
  442.    -D   Alternate display mode
  443.  
  444.         This options alters the layout of LZ's screen updates.  For example,
  445.         -D1 will use the characters -\|/ to mimic MS-DOS pre 1.10 Pkzip, while
  446.         -D2 will mimc MS-DOS Pkzip 1.10's percentage update.  -D0 is the
  447.         default, and activates the standard LZ display.
  448.  
  449.  
  450.    -f   Ignore filenotes
  451.  
  452.         The -f flag will cause LZ to ignore filenotes when archiving or
  453.         extracting files.
  454.  
  455.  
  456.    -i   Read file list from file
  457.  
  458.         This option allows you to specify that LZ read a list of files to be
  459.         archived, from a text file.  Entering -iRAM:FileList will cause LZ
  460.         to read the names of the files stored in RAM:FileList.
  461.  
  462.  
  463.    -l   Lower case filenames
  464.  
  465.         This option forces all file names to lower case.  If used when
  466.         archiving, all files added will have their names converted to lower
  467.         case.  If used when extracting, all files extracted will have their
  468.         names converted to lower case.
  469.  
  470.  
  471.    -L   Create list file
  472.  
  473.         This option causes LZ to create a text file containing a list of all
  474.         files added to an archive.  For example:
  475.  
  476.         LZ -LRAM:ListFile a RAM:Archive.lzh hello/blah1 blah2
  477.  
  478.         will cause LZ to create a file named "ListFile" containing:
  479.  
  480.         hello/blah1
  481.         blah2
  482.  
  483.         If you insert a + after the -L, LZ will output the full path name of
  484.         the files added.
  485.  
  486.  
  487.    -m   No message query
  488.  
  489.         Invoking this option will prevent LZ from prompting you for input.  It
  490.         will also cause files to be automatically overwritten if they already
  491.         exist.  This is often useful in conjunction with scripts and BBS's.
  492.  
  493.  
  494.    -n   No progress indicator
  495.  
  496.         This option will prevent LZ from displaying a byte count as it extracts
  497.         or archives files.  This can be useful if you are redirecting the
  498.         output of LZ to a file.
  499.  
  500.  
  501.    -N   No console output (or "absolutely no progress indicator")
  502.  
  503.         If this option is invoked, LZ will not display any text to the screen.
  504.         This option automatically turns on the -m option, so that if LZ ever
  505.         does require input from you, it won't just sit there.
  506.  
  507.         This option is useful in conjunction with BBS software.  Note the
  508.         differences between this option and the -n option.  Also note that this
  509.         option is incompatible with Amiga Lharc, which will take -N to mean -n.
  510.  
  511.  
  512.    -p   Pause after loading
  513.  
  514.         This option will cause LZ to prompt you for a keypress after it has
  515.         loaded.  This can be useful if you have only one floppy drive, and LZ
  516.         is on another disk.
  517.  
  518.  
  519.    -P   Set task priority
  520.  
  521.         The -P option enables you to set the task priority of LZ.  The task
  522.         priority must immediately follow the -P; for example, -P1, or -P-1.
  523.         This can be useful if wish to set LZ to a negative priority and leave
  524.         it running in the background while you are calling BBS's.
  525.  
  526.  
  527.    -r   Archive subdirectories
  528.  
  529.         This option will cause LZ to recursively collect files from
  530.         subdirectories, and is usually used in conjunction with the -x option.
  531.         For example, to add all files on drive df0: (including subdirectories)
  532.         to mydisk.LZH, you would use:
  533.  
  534.         LZ -x -r a mydisk.LZH DF0:#?
  535.  
  536.  
  537.    -u   Upper case filenames
  538.  
  539.         This option forces all file names to upper case.  If used when
  540.         archiving, all files added will have their names converted to upper
  541.         case.  If used when extracting, all files extracted will have their
  542.         names converted to upper case.  This option is provided for
  543.         compatibility with MS-DOS Lharc.
  544.  
  545.  
  546.    -U   Update rate
  547.  
  548.         This option sets the rate (in bytes) at which LZ updates its byte
  549.         count (or alternate display, if set with -D).  It currently defaults
  550.         to 1024 bytes.  The following example sets the update rate to 4096
  551.         bytes:
  552.  
  553.         -U4096
  554.  
  555.  
  556.    -w   Set work directory
  557.  
  558.         When creating archives, individual files are compressed in the work
  559.         directory, which defaults to T: if it exists, or the current directory
  560.         otherwise.  The -w option allows the location of the work directory to
  561.         be changed; the name of the new work directory should immediately
  562.         follow the -w.
  563.  
  564.  
  565.    -x   Preserve path names
  566.  
  567.         This option forces LZ to preserve the full path names of any files
  568.         added, and is most commonly used in conjunction with the -r option.
  569.  
  570.  
  571.    -z   Zero compression
  572.  
  573.         This option is only valid when adding files, and, if invoked, will
  574.         cause all files added to be merely stored in the archive, not
  575.         compressed.  This is not a very useful option, but has been included
  576.         for the sake of completeness.
  577.  
  578.  
  579.    -Z   Compress archives
  580.  
  581.         By default, LZ will NOT attempt to compress files ending in .lzh, .lhw,
  582.         .zip, .zoo, .arc, .pak, .wrp, .zap, .dms, or .arj, since these files
  583.         are already compressed.  If the -Z option is used, then files with
  584.         these extensions WILL be compressed.
  585.  
  586.  
  587.    Conclusion
  588.  
  589.    LZ does not yet have all of its commands implemented; the commands not
  590. implemented are:  move, freshen, and update.
  591.  
  592.    Like Amiga Lharc, LZ uses the decimal address of its task structure for
  593. creating temporary filenames, so that multiple copies can run simultaneously
  594. without conflict (and no, LZ is not reentrant; I *like* global variables).
  595.  
  596.    If you find yourself using certain options with LZ most of the time, you
  597. might want to make them an alias.  For example, if you find yourself typing
  598. "Lhunarc" all the time:
  599.  
  600.    alias lhunarc LZ -b32 []
  601.  
  602.    The above two command works only with shells which support aliases.  Your
  603. shell might have a different way of doing it; I use AmigaDOS 1.3 and Arp 1.3.
  604.  
  605.  
  606.    Acknowledgements
  607.  
  608.    Haruyasu Yoshizaki - For lharc.c and lzhuf.c (the algorithm)
  609.  
  610.    Steve Tibbett      - For showing me how to speed up Lhunarc 0.96 by 3%
  611.                         For RawDoFmt(), and __tinymain
  612.                         For finding the bug in the view command
  613.                         For Raw() and Cooked()
  614.                         For suggesting a user configurable buffer
  615.  
  616.    Rob Collinsworth   - For finding the bugs in the algorithm when it was
  617.                         in Lhwarp
  618.  
  619.    Chris Larcombe     - For finding the zero length file bug in version 0.81
  620.  
  621.    Robert Jung        - For all the information on file compression.
  622.  
  623.    Timothy C. Bell    - For explaining everything from semiadaptive dictionary
  624.    John G. Cleary       techniques and statistical encoding to digital hash
  625.    Ian H. Witten        tries and finite context models.
  626.